3.91 \(\int (a g+b g x) (A+B \log (\frac {e (a+b x)}{c+d x})) \, dx\)
Optimal. Leaf size=81 \[ \frac {g (a+b x)^2 \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )}{2 b}+\frac {B g (b c-a d)^2 \log (c+d x)}{2 b d^2}-\frac {B g x (b c-a d)}{2 d} \]
[Out]
-1/2*B*(-a*d+b*c)*g*x/d+1/2*g*(b*x+a)^2*(A+B*ln(e*(b*x+a)/(d*x+c)))/b+1/2*B*(-a*d+b*c)^2*g*ln(d*x+c)/b/d^2
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 81, normalized size of antiderivative = 1.00,
number of steps used = 4, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used =
{2525, 12, 43} \[ \frac {g (a+b x)^2 \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )}{2 b}+\frac {B g (b c-a d)^2 \log (c+d x)}{2 b d^2}-\frac {B g x (b c-a d)}{2 d} \]
Antiderivative was successfully verified.
[In]
Int[(a*g + b*g*x)*(A + B*Log[(e*(a + b*x))/(c + d*x)]),x]
[Out]
-(B*(b*c - a*d)*g*x)/(2*d) + (g*(a + b*x)^2*(A + B*Log[(e*(a + b*x))/(c + d*x)]))/(2*b) + (B*(b*c - a*d)^2*g*L
og[c + d*x])/(2*b*d^2)
Rule 12
Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] && !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]
Rule 43
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])
Rule 2525
Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Simp[((d + e*x)^(m
+ 1)*(a + b*Log[c*RFx^p])^n)/(e*(m + 1)), x] - Dist[(b*n*p)/(e*(m + 1)), Int[SimplifyIntegrand[((d + e*x)^(m +
1)*(a + b*Log[c*RFx^p])^(n - 1)*D[RFx, x])/RFx, x], x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && RationalFunc
tionQ[RFx, x] && IGtQ[n, 0] && (EqQ[n, 1] || IntegerQ[m]) && NeQ[m, -1]
Rubi steps
\begin {align*} \int (a g+b g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right ) \, dx &=\frac {g (a+b x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{2 b}-\frac {B \int \frac {(b c-a d) g^2 (a+b x)}{c+d x} \, dx}{2 b g}\\ &=\frac {g (a+b x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{2 b}-\frac {(B (b c-a d) g) \int \frac {a+b x}{c+d x} \, dx}{2 b}\\ &=\frac {g (a+b x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{2 b}-\frac {(B (b c-a d) g) \int \left (\frac {b}{d}+\frac {-b c+a d}{d (c+d x)}\right ) \, dx}{2 b}\\ &=-\frac {B (b c-a d) g x}{2 d}+\frac {g (a+b x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{2 b}+\frac {B (b c-a d)^2 g \log (c+d x)}{2 b d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 69, normalized size = 0.85 \[ \frac {g \left ((a+b x)^2 \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )+\frac {B (a d-b c) ((a d-b c) \log (c+d x)+b d x)}{d^2}\right )}{2 b} \]
Antiderivative was successfully verified.
[In]
Integrate[(a*g + b*g*x)*(A + B*Log[(e*(a + b*x))/(c + d*x)]),x]
[Out]
(g*((a + b*x)^2*(A + B*Log[(e*(a + b*x))/(c + d*x)]) + (B*(-(b*c) + a*d)*(b*d*x + (-(b*c) + a*d)*Log[c + d*x])
)/d^2))/(2*b)
________________________________________________________________________________________
fricas [A] time = 0.79, size = 125, normalized size = 1.54 \[ \frac {A b^{2} d^{2} g x^{2} + B a^{2} d^{2} g \log \left (b x + a\right ) - {\left (B b^{2} c d - {\left (2 \, A + B\right )} a b d^{2}\right )} g x + {\left (B b^{2} c^{2} - 2 \, B a b c d\right )} g \log \left (d x + c\right ) + {\left (B b^{2} d^{2} g x^{2} + 2 \, B a b d^{2} g x\right )} \log \left (\frac {b e x + a e}{d x + c}\right )}{2 \, b d^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((b*g*x+a*g)*(A+B*log(e*(b*x+a)/(d*x+c))),x, algorithm="fricas")
[Out]
1/2*(A*b^2*d^2*g*x^2 + B*a^2*d^2*g*log(b*x + a) - (B*b^2*c*d - (2*A + B)*a*b*d^2)*g*x + (B*b^2*c^2 - 2*B*a*b*c
*d)*g*log(d*x + c) + (B*b^2*d^2*g*x^2 + 2*B*a*b*d^2*g*x)*log((b*e*x + a*e)/(d*x + c)))/(b*d^2)
________________________________________________________________________________________
giac [B] time = 0.97, size = 1319, normalized size = 16.28 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((b*g*x+a*g)*(A+B*log(e*(b*x+a)/(d*x+c))),x, algorithm="giac")
[Out]
-1/2*(B*b^5*c^3*g*e^3*log(-b*e + (b*x*e + a*e)*d/(d*x + c)) - 3*B*a*b^4*c^2*d*g*e^3*log(-b*e + (b*x*e + a*e)*d
/(d*x + c)) + 3*B*a^2*b^3*c*d^2*g*e^3*log(-b*e + (b*x*e + a*e)*d/(d*x + c)) - B*a^3*b^2*d^3*g*e^3*log(-b*e + (
b*x*e + a*e)*d/(d*x + c)) - 2*(b*x*e + a*e)*B*b^4*c^3*d*g*e^2*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c)
+ 6*(b*x*e + a*e)*B*a*b^3*c^2*d^2*g*e^2*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c) - 6*(b*x*e + a*e)*B*a^
2*b^2*c*d^3*g*e^2*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c) + 2*(b*x*e + a*e)*B*a^3*b*d^4*g*e^2*log(-b*e
+ (b*x*e + a*e)*d/(d*x + c))/(d*x + c) + (b*x*e + a*e)^2*B*b^3*c^3*d^2*g*e*log(-b*e + (b*x*e + a*e)*d/(d*x +
c))/(d*x + c)^2 - 3*(b*x*e + a*e)^2*B*a*b^2*c^2*d^3*g*e*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c)^2 + 3*
(b*x*e + a*e)^2*B*a^2*b*c*d^4*g*e*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c)^2 - (b*x*e + a*e)^2*B*a^3*d^
5*g*e*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c)^2 - (b*x*e + a*e)^2*B*b^3*c^3*d^2*g*e*log((b*x*e + a*e)/
(d*x + c))/(d*x + c)^2 + 3*(b*x*e + a*e)^2*B*a*b^2*c^2*d^3*g*e*log((b*x*e + a*e)/(d*x + c))/(d*x + c)^2 - 3*(b
*x*e + a*e)^2*B*a^2*b*c*d^4*g*e*log((b*x*e + a*e)/(d*x + c))/(d*x + c)^2 + (b*x*e + a*e)^2*B*a^3*d^5*g*e*log((
b*x*e + a*e)/(d*x + c))/(d*x + c)^2 + A*b^5*c^3*g*e^3 + B*b^5*c^3*g*e^3 - 3*A*a*b^4*c^2*d*g*e^3 - 3*B*a*b^4*c^
2*d*g*e^3 + 3*A*a^2*b^3*c*d^2*g*e^3 + 3*B*a^2*b^3*c*d^2*g*e^3 - A*a^3*b^2*d^3*g*e^3 - B*a^3*b^2*d^3*g*e^3 - 2*
(b*x*e + a*e)*A*b^4*c^3*d*g*e^2/(d*x + c) - (b*x*e + a*e)*B*b^4*c^3*d*g*e^2/(d*x + c) + 6*(b*x*e + a*e)*A*a*b^
3*c^2*d^2*g*e^2/(d*x + c) + 3*(b*x*e + a*e)*B*a*b^3*c^2*d^2*g*e^2/(d*x + c) - 6*(b*x*e + a*e)*A*a^2*b^2*c*d^3*
g*e^2/(d*x + c) - 3*(b*x*e + a*e)*B*a^2*b^2*c*d^3*g*e^2/(d*x + c) + 2*(b*x*e + a*e)*A*a^3*b*d^4*g*e^2/(d*x + c
) + (b*x*e + a*e)*B*a^3*b*d^4*g*e^2/(d*x + c))*(b*c/((b*c*e - a*d*e)*(b*c - a*d)) - a*d/((b*c*e - a*d*e)*(b*c
- a*d)))/(b^3*d^2*e^2 - 2*(b*x*e + a*e)*b^2*d^3*e/(d*x + c) + (b*x*e + a*e)^2*b*d^4/(d*x + c)^2)
________________________________________________________________________________________
maple [B] time = 0.13, size = 1544, normalized size = 19.06 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((b*g*x+a*g)*(A+B*ln(e*(b*x+a)/(d*x+c))),x)
[Out]
-1/2/d^2*B*g*ln((b*e/d+(a*d-b*c)*e/d/(d*x+c))*d-b*e)*c^2*b+1/d*B*g*ln((b*e/d+(a*d-b*c)*e/d/(d*x+c))*d-b*e)*c*a
+1/2*e^2*A*g*b/(d*e/(d*x+c)*a-e/(d*x+c)*b*c)^2*a^2+e*B*g*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))/(d*e/(d*x+c)*a-e/(d*x
+c)*b*c)*a^2+1/2*e*B*g/(d*e/(d*x+c)*a-e/(d*x+c)*b*c)*a^2-1/2*B*g/b*ln((b*e/d+(a*d-b*c)*e/d/(d*x+c))*d-b*e)*a^2
+e*A*g/(d*e/(d*x+c)*a-e/(d*x+c)*b*c)*a^2-2/d*e*A*g/(d*e/(d*x+c)*a-e/(d*x+c)*b*c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d*e/(d*x+c)*a-e/(d*x+c)*b*c)^2*c^4/(d*x+c)^2*b^3-2/d*e*B*g*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))/(d*e/(d*x+c)*a-e/
(d*x+c)*b*c)*c*b*a-1/d*e^2*B*g*b^2*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))/(d*e/(d*x+c)*a-e/(d*x+c)*b*c)^2*a*c-1/d^2*e
*B*g*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))/(d*e/(d*x+c)*a-e/(d*x+c)*b*c)*c^3/(d*x+c)*b^2+d*e*B*g*ln(b*e/d+(a*d-b*c)*
e/d/(d*x+c))/b/(d*e/(d*x+c)*a-e/(d*x+c)*b*c)*a^3/(d*x+c)+2*d*e^2*B*g*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))/(d*e/(d*x
+c)*a-e/(d*x+c)*b*c)^2*a^3/(d*x+c)^2*c
________________________________________________________________________________________
maxima [A] time = 1.46, size = 144, normalized size = 1.78 \[ \frac {1}{2} \, A b g x^{2} + {\left (x \log \left (\frac {b e x}{d x + c} + \frac {a e}{d x + c}\right ) + \frac {a \log \left (b x + a\right )}{b} - \frac {c \log \left (d x + c\right )}{d}\right )} B a g + \frac {1}{2} \, {\left (x^{2} \log \left (\frac {b e x}{d x + c} + \frac {a e}{d x + c}\right ) - \frac {a^{2} \log \left (b x + a\right )}{b^{2}} + \frac {c^{2} \log \left (d x + c\right )}{d^{2}} - \frac {{\left (b c - a d\right )} x}{b d}\right )} B b g + A a g x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((b*g*x+a*g)*(A+B*log(e*(b*x+a)/(d*x+c))),x, algorithm="maxima")
[Out]
1/2*A*b*g*x^2 + (x*log(b*e*x/(d*x + c) + a*e/(d*x + c)) + a*log(b*x + a)/b - c*log(d*x + c)/d)*B*a*g + 1/2*(x^
2*log(b*e*x/(d*x + c) + a*e/(d*x + c)) - a^2*log(b*x + a)/b^2 + c^2*log(d*x + c)/d^2 - (b*c - a*d)*x/(b*d))*B*
b*g + A*a*g*x
________________________________________________________________________________________
mupad [B] time = 4.30, size = 126, normalized size = 1.56 \[ x\,\left (\frac {g\,\left (4\,A\,a\,d+2\,A\,b\,c+B\,a\,d-B\,b\,c\right )}{2\,d}-\frac {A\,g\,\left (2\,a\,d+2\,b\,c\right )}{2\,d}\right )+\ln \left (\frac {e\,\left (a+b\,x\right )}{c+d\,x}\right )\,\left (\frac {B\,b\,g\,x^2}{2}+B\,a\,g\,x\right )+\frac {\ln \left (c+d\,x\right )\,\left (B\,b\,c^2\,g-2\,B\,a\,c\,d\,g\right )}{2\,d^2}+\frac {A\,b\,g\,x^2}{2}+\frac {B\,a^2\,g\,\ln \left (a+b\,x\right )}{2\,b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((a*g + b*g*x)*(A + B*log((e*(a + b*x))/(c + d*x))),x)
[Out]
x*((g*(4*A*a*d + 2*A*b*c + B*a*d - B*b*c))/(2*d) - (A*g*(2*a*d + 2*b*c))/(2*d)) + log((e*(a + b*x))/(c + d*x))
*((B*b*g*x^2)/2 + B*a*g*x) + (log(c + d*x)*(B*b*c^2*g - 2*B*a*c*d*g))/(2*d^2) + (A*b*g*x^2)/2 + (B*a^2*g*log(a
+ b*x))/(2*b)
________________________________________________________________________________________
sympy [B] time = 1.95, size = 253, normalized size = 3.12 \[ \frac {A b g x^{2}}{2} + \frac {B a^{2} g \log {\left (x + \frac {\frac {B a^{3} d^{2} g}{b} + 2 B a^{2} c d g - B a b c^{2} g}{B a^{2} d^{2} g + 2 B a b c d g - B b^{2} c^{2} g} \right )}}{2 b} - \frac {B c g \left (2 a d - b c\right ) \log {\left (x + \frac {3 B a^{2} c d g - B a b c^{2} g - B a c g \left (2 a d - b c\right ) + \frac {B b c^{2} g \left (2 a d - b c\right )}{d}}{B a^{2} d^{2} g + 2 B a b c d g - B b^{2} c^{2} g} \right )}}{2 d^{2}} + x \left (A a g + \frac {B a g}{2} - \frac {B b c g}{2 d}\right ) + \left (B a g x + \frac {B b g x^{2}}{2}\right ) \log {\left (\frac {e \left (a + b x\right )}{c + d x} \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((b*g*x+a*g)*(A+B*ln(e*(b*x+a)/(d*x+c))),x)
[Out]
A*b*g*x**2/2 + B*a**2*g*log(x + (B*a**3*d**2*g/b + 2*B*a**2*c*d*g - B*a*b*c**2*g)/(B*a**2*d**2*g + 2*B*a*b*c*d
*g - B*b**2*c**2*g))/(2*b) - B*c*g*(2*a*d - b*c)*log(x + (3*B*a**2*c*d*g - B*a*b*c**2*g - B*a*c*g*(2*a*d - b*c
) + B*b*c**2*g*(2*a*d - b*c)/d)/(B*a**2*d**2*g + 2*B*a*b*c*d*g - B*b**2*c**2*g))/(2*d**2) + x*(A*a*g + B*a*g/2
- B*b*c*g/(2*d)) + (B*a*g*x + B*b*g*x**2/2)*log(e*(a + b*x)/(c + d*x))
________________________________________________________________________________________